package com.yjt.gcss.gddw.common.bean.domain;

import java.util.HashMap;
import java.util.Map;

import com.yjt.common.tools.TimeUtil;

/**
 * InfoSxxy entity. @author MyEclipse Persistence Tools
 */
public class InfoSxxy extends AbstractInfoSxxy implements java.io.Serializable {
	/**
	 * 
	 */
	public static final String BEAN_PACKAGE_NAME = "com.yjt.gcss.gddw.common.bean.domain.InfoSxxy";
	private static final long serialVersionUID = 1L;
	private String query_start_date_active_date;
	private String query_end_date_active_date;
	private String entrustDateDescr;
	private String activeDateDescr;
	// Constructors

	/** default constructor */
	public InfoSxxy() {
	}

	/** minimal constructor */
	public InfoSxxy(InfoSxxyId id, String protNo, String userName,
			String entrustDate, String contactNo, String payerBank,
			String payerAcc, String payerName) {
		super(id, protNo, userName, entrustDate, contactNo, payerBank,
				payerAcc, payerName);
	}

	/** full constructor */
	public InfoSxxy(InfoSxxyId id, String protNo, String userName,
			String entrustDate, String contactAddr, String contactName,
			String activeDate, String contactAddrpost, String contactNo,
			String payerBank, String payerAcc, String payerName,
			String payerCreditType, String payerCreditNo, String payerMobile,
			String payerEmail, String remark, String signPlace, String synFlag,
			String reserve) {
		super(id, protNo, userName, entrustDate, contactAddr, contactName,
				activeDate, contactAddrpost, contactNo, payerBank, payerAcc,
				payerName, payerCreditType, payerCreditNo, payerMobile,
				payerEmail, remark, signPlace, synFlag, reserve);
	}

	// 协议类型
	public String getProtNoType() {
		String ProtNo = this.getProtNo();
		Map<String,String> protNoType=new HashMap<String, String>();
		protNoType.put("01", "代收协议");
		protNoType.put("02", "代付协议");  
		if (ProtNo != null && !("").equals(ProtNo)) {
			String pt = this.getProtNo().substring(0, 2);
			return protNoType.get(pt);  
		}  
		return ""; 
	}  
	
	//签约单位
	public String getSignPlaceDesc(){ 
		String signPlace=this.getSignPlace();
		if(signPlace != null && !("").equals(signPlace)){
			if(signPlace.equals("ORG")){
				return "机构";
			}else{
				return "银行";
			}
		}
		return "";   
	}
	
	 //同步标识
  	public String getSynFlagDesc(){
  		String synFlag=this.getSynFlag();
  		Map<String,String> synFlagCHMap=new HashMap<String, String>();
  		synFlagCHMap.put("S", "已同步");
  		synFlagCHMap.put("N", "未同步"); 	
  		return synFlagCHMap.get(synFlag);      
  	}
  	
 	
    //付款人证件类型 	
  	public String getPayerCreditTypeDesc(){
  		Map<String,String> payerCreditTypeCHMap=new HashMap<String, String>();
  		payerCreditTypeCHMap.put("0", "身份证");
  		payerCreditTypeCHMap.put("1", "户口簿");
  		payerCreditTypeCHMap.put("2", "护照");
  		payerCreditTypeCHMap.put("3", "军官证");
  		payerCreditTypeCHMap.put("4", "士兵证");
  		payerCreditTypeCHMap.put("5", "港澳居民来往内地通行证");
  		payerCreditTypeCHMap.put("6", "台湾同胞来往内地通行证");
  		payerCreditTypeCHMap.put("7", "临时身份证");
  		payerCreditTypeCHMap.put("8", "外国人居留证");
  		payerCreditTypeCHMap.put("9", "警官证");
  		payerCreditTypeCHMap.put("X", "其他证件");
  		return payerCreditTypeCHMap.get(this.getPayerCreditType());
  	}
  	
	
	//机构号
	public String getOrgIdTest(){
		
		return this.getId().getOrgId();
	}
	
	//业务类型
	public String getTranTypeTest(){
		return this.getId().getTranType();
	}
	//用户标号
	public String getUserNoTest(){  
		return this.getId().getUserNo();
	}
	
	public String getEntrustDateDescr() {
		if(TimeUtil.checkDate(this.getEntrustDate(), "yyyyMMdd")) {
			return TimeUtil.changeStrTimeFormat(this.getEntrustDate(), "yyyyMMdd", "yyyy-MM-dd");
		}
		return "";
	}
	
	public String getActiveDateDescr() {
		if(TimeUtil.checkDate(this.getActiveDate(), "yyyyMMdd")) {
			return TimeUtil.changeStrTimeFormat(this.getActiveDate(), "yyyyMMdd", "yyyy-MM-dd");
		}
		return "";
	}
	
	public String getQuery_start_date_active_date() {
		return query_start_date_active_date;
	}

	public void setQuery_start_date_active_date(String query_start_date_active_date) {
		this.query_start_date_active_date = query_start_date_active_date;
	}

	public String getQuery_end_date_active_date() {
		return query_end_date_active_date;
	}

	public void setQuery_end_date_active_date(String query_end_date_active_date) {
		this.query_end_date_active_date = query_end_date_active_date;
	}

}
